// import styled from "styled-components"
// import { ICreatedByInputProps } from "./types"
import { Input } from "antd"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import { useLocale } from "@/locales"
interface MemberNameInputProps {
	memberName?: string
	label?: string
	placeholder?: string
	normalize?: ((value: any, prevValue: any, allValues: any) => any) | undefined
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const MemberNameInput: FC<MemberNameInputProps> = ({ label, placeholder, memberName, normalize }) => {
	const { formatMessage } = useLocale()
	const defaultNormalize = (value: string) => value.replaceAll(" ", "") || undefined

	return (
		<SFormItem
			name={memberName ?? "userName"}
			label={`${formatMessage({ id: label || "label.memberName" })}:`}
			normalize={normalize || defaultNormalize}
		>
			<Input placeholder={placeholder ? placeholder : formatMessage({ id: "label.memberName" })} allowClear />
		</SFormItem>
	)
}

export default MemberNameInput
